home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 699 b | 38 lines | [TEXT/CWIE] |
- // ListNode.h
-
- #ifndef ListNode_h
- #define ListNode_h
-
- #ifndef Assert_h
- #include "Assert.h"
- #endif
-
- class ListNode
- {
- friend class List;
-
- private:
- ListNode *next; // mutable
- ListNode *previous; // mutable
- List *owner;
-
- // not implemented:
- ListNode( const ListNode& );
- void operator=( const ListNode& );
-
- public:
- ListNode();
- ~ListNode();
-
- const ListNode *Next() const { return next; }
- const ListNode *Previous() const { return previous; }
-
- ListNode *Next() { return next; }
- ListNode *Previous() { return previous; }
-
- bool Owned() const { return owner != 0; }
- List& Owner() const { Assert( owner != 0 ); return *owner; }
- };
-
- #endif
-